package domain;
/*
  The squares in the board, holds a value and the owner.
*/
/*
  IMPLEMENTATION STATUS
   - Done.
 */
public class Square {

    private int owner;

    // Constructor.
    public Square(int owner) {
        this.owner = owner;
    }

    public int getOwner() {
        return owner;
    }


    public boolean isOponent(Square oponent){
        if(owner == 1){
            if (oponent.getOwner()==2){
                return true;
            }
        }
        if(owner == 2){
            if (oponent.getOwner()==1){
                return true;
            }
        }
        return false;
    }
    public boolean isOponent(int otherOwner){
        if(otherOwner == 1){
            if (this.getOwner()==2){
                return true;
            }
        }
        if(otherOwner == 2){
            if (this.getOwner()==1){
                return true;
            }
        }
        return false;
    }

    public void setOwner(int owner) {
        this.owner = owner;
    }
}
